﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;

public partial class system_linkmans : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
            string inman = Request["uid"].ToString();
            string pagenum = Request["pagenum"].ToString();
            
            mylinkmans.Text = GetLinkmans(inman,pagenum);
        }
    }

    private string GetLinkmans(string inman,string pagenum)
    {
        string result = "<table border=0 align=left><tr><td><table id=\"mymans\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" style='BORDER-COLLAPSE: collapse;font-size: 10pt;' bordercolor=\"#cfdfff\" align=\"left\">";

        result += "<thead>";
        result += "<tr height=30>";
        result += "<td align=center style=\"background-color: #ffcc99;\" nowrap=\"nowrap\">序号</td><td style=\"background-color: #ffcc99;\">姓名</td><td style=\"background-color: #ffcc99;\">公司</td><td style=\"background-color: #ffcc99;\">部门</td><td style=\"background-color: #ffcc99;\">职位</td><td style=\"background-color: #ffcc99;\">单位类型</td><td style=\"background-color: #ffcc99;\" nowrap=\"nowrap\">服务的公司</td><td style=\"background-color: #ffcc99;\">固话</td><td style=\"background-color: #ffcc99;\">手机</td><td style=\"background-color: #ffcc99;\">电邮</td>";
        result += "</tr>";
        result += "</thead>";

        result += "<tbody>";
        TUser oMans = new TUser(inman);
        oMans.Select();
        oMans.GetPage(Convert.ToInt32(pagenum));
        while (oMans.RResults.Read())
        {
            result += "<tr height=22>";
            result += "<td nowrap=\"nowrap\" align=center>" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("rownum")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("linkman")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("company")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("dept")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("jobposi")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("unittype")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("srvcompany")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("tel")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("mobile")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oMans.RResults.GetValue(oMans.RResults.GetOrdinal("email")).ToString() + "</td>";
            result += "</tr>";
        }
        result += "</tbody>";

        result += "</table></td></tr><tr><td>";

        result += oMans.GenPagebar(Convert.ToInt32(pagenum))+"</td></tr></table>";

        return result;
    }
}
